package com.excerise.object;

/**
 *
 *
 * @author Way on 2021/7/26
 */
public class PropertiesTest {
    public static void main(String[] args) {
        // person 是对象名（对象引用）
        // new Person()创建的对象空间（数据）才是真正的对象
        Person person = new Person();

        // 对象的属性默认值，遵守数组规则
        /**
         * int 0
         * short 0
         * byte 0
         * long 0
         * float 0.0
         * double 0.0
         * char \u0000
         * boolean false
         */
        System.out.println(person);
    }
}

class Person {
    String name;
    int age;
    short status;
    double salary;

    @Override
    public String toString() {
        return "Person{" +
                "name=" + name +
                ", age=" + age +
                ", status=" + status +
                ", salary=" + salary +
                '}';
    }
}